package org.assistant.csp.data;

import java.util.HashMap;
import java.util.Map;

import my.assistant.homecashmanager.account.data.AccountBase;

/**
 * 放在session中的缓存
 * 
 * @author eagle
 * 
 */
public class CacheInSession {
	/**
	 * 用户所有账户信息的缓存<br>
	 * key:账户ID；value:账户信息
	 */
	private Map<String, AccountBase> cacheAccountMap;

	public Map<String, AccountBase> getCacheAccountMap() {
		return cacheAccountMap;
	}

	public void setCacheAccountMap(Map<String, AccountBase> cacheAccountMap) {
		this.cacheAccountMap = cacheAccountMap;
	}

	public AccountBase putAccount(String id, AccountBase account) {
		if (null == cacheAccountMap) {
			cacheAccountMap = new HashMap<String, AccountBase>();
		}
		return cacheAccountMap.put(id, account);
	}
}
